package cn.iocoder.yudao.module.engine.service.core.aichat.client;

import cn.iocoder.yudao.module.engine.enums.EnumActionType;
import cn.iocoder.yudao.module.engine.model.context.AIMessageContext;
import cn.iocoder.yudao.module.engine.model.aichat.AIChatReplayMessage;

import java.io.IOException;
import java.util.concurrent.Semaphore;

public interface ILLMChatClient {

    default Semaphore getSemaphore(EnumActionType actionType) {
        return new Semaphore(1);
    }

    default void complete(AIMessageContext messageCtx) {
    }

    default void completeWithError(AIMessageContext messageCtx, Throwable ex) {
    }

    void send(AIMessageContext messageCtx, AIChatReplayMessage msg) throws IOException;

}
